Skip to content

Fix SPA routing on GitHub Pages#16

Merged
nahiyankhan merged 1 commit intomainfrom
fix/spa-base-path
Apr 7, 2026
Merged

Fix SPA routing on GitHub Pages#16
nahiyankhan merged 1 commit intomainfrom
fix/spa-base-path

Conversation

@nahiyankhan
Copy link
Copy Markdown
Collaborator

@nahiyankhan nahiyankhan commented Apr 7, 2026

Summary

  • Set basename on BrowserRouter using VITE_BASE_PATH so React Router resolves all routes relative to /ghost/
  • Without this, navigating to Home or any route on block.github.io/ghost/ would resolve against / instead of /ghost/

Test plan

🤖 Generated with Claude Code

Without basename, React Router resolved all routes against "/" instead
of "/ghost/", causing navigation to break on block.github.io/ghost/.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@nahiyankhan nahiyankhan merged commit 769dddf into main Apr 7, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant